#include "systempreset.h"
#include "filepathmanager.h"

SystemPreset *SystemPreset::instance()
{
    static SystemPreset inst;
    return &inst;
}

SystemPreset::SystemPreset() : PresetServer(FilePathManager::instance()->configFile())
{
    registerItem(EnumPresetItem::Language, "Language", "CN");
    registerItem(EnumPresetItem::SerialPortName, "SerialPortName", "/dev/ttyS1");

    registerItem(EnumPresetItem::VoltageProbeRate, "VoltageProbeRate", "200");
    registerItem(EnumPresetItem::CurrentProbeRate, "CurrentProbeRate", "1");
    registerItem(EnumPresetItem::VoltageChannelCoef, "VoltageChannelCoef", "1.0");
    registerItem(EnumPresetItem::CurrentChannelCoef, "CurrentChannelCoef", "1.0");
    registerItem(EnumPresetItem::VoltageZeroPos, "VoltageZeroPos", "0.0");
    registerItem(EnumPresetItem::CurrentZeroPos, "CurrentZeroPos", "0.0");

    registerItem(EnumPresetItem::VoltageCalibCoef, "VoltageCalibCoef", "1.0");
    registerItem(EnumPresetItem::FlowRateCalibCoef, "FlowRateCalibCoef", "1.0");

    registerItem(EnumPresetItem::BuzzerCardId, "BuzzerCardId", "0");
    registerItem(EnumPresetItem::BuzzerDeviceId, "BuzzerDeviceId", "0");
    registerItem(EnumPresetItem::BuzzerAudioVolume, "BuzzerAudioVolume", "30");
    registerItem(EnumPresetItem::BuzzerAudioFile, "BuzzerAudioFile", "alarm-700.wav");

    registerItem(EnumPresetItem::DiskMinSize, "DiskMinSize", "100");
    registerItem(EnumPresetItem::DiskWarningSize, "DiskWarningSize", "1024");

    registerItem(EnumPresetItem::DisableSystemDesktop, "DisableSystemDesktop", "0");
    registerItem(EnumPresetItem::OpenAutoFillBarCode, "OpenAutoFillBarCode", "0");
    registerItem(EnumPresetItem::ShowStartupButton, "ShowStartupButton", "0");
    registerItem(EnumPresetItem::ShowRememberPassWord, "ShowRememberPassWord", "0");
    registerItem(EnumPresetItem::AllowLoginWhenBootFail, "AllowLoginWhenBootFail", "1");

    registerItem(EnumPresetItem::RememberPassWord, "RememberPassWord", "0");
    registerItem(EnumPresetItem::LastLoginUser, "LastLoginUser", "admin");
    registerItem(EnumPresetItem::LastLoginToken, "LastLoginToken", "");

    registerItem(EnumPresetItem::CompanyChecked, "CompanyChecked", "1");
    registerItem(EnumPresetItem::EquipmentChecked, "EquipmentChecked", "1");
    registerItem(EnumPresetItem::SerialChecked, "SerialChecked", "1");
    registerItem(EnumPresetItem::UserChecked, "UserChecked", "1");
    registerItem(EnumPresetItem::DatetimeChecked, "DatetimeChecked", "1");
    registerItem(EnumPresetItem::PageSize, "PageSize", "0");
    registerItem(EnumPresetItem::TableWidth, "TableWidth", "800");

    registerItem(EnumPresetItem::IPAddress, "IPAddress", "192.168.0.50");
    registerItem(EnumPresetItem::SubnetMask, "SubnetMask", "255.255.255.0");
    registerItem(EnumPresetItem::Gateway, "Gateway", "192.168.0.1");
    registerItem(EnumPresetItem::DNS, "DNS", "192.168.0.1");
    registerItem(EnumPresetItem::RemoteIP, "RemoteIP", "192.168.0.51");
    registerItem(EnumPresetItem::PrintIP, "PrintIP", "192.168.0.52");

    registerItem(EnumPresetItem::InstrumentName, "InstrumentName", "X-Porator M1");
    registerItem(EnumPresetItem::InstrumentType, "InstrumentType", "EBXP-M1");
    registerItem(EnumPresetItem::SerialNumber, "SerialNumber", "");
    registerItem(EnumPresetItem::CompanyName, "CompanyName", "Etta Biotech Co., Ltd.");
    registerItem(EnumPresetItem::CompanyAddress, "CompanyAddress", "#2-501, 200 Xingpu Rd., Shengpu Town, Suzhou Industrial Park, Suzhou, China");
    registerItem(EnumPresetItem::CompanyTelephone, "CompanyTelephone", "0512-62991988");

    registerItem(EnumPresetItem::SelfTestMaxTimes, "SelfTestMaxTimes", "20");
    registerItem(EnumPresetItem::StopExpDlayTimes, "StopExpDlayTimes", "300");
    registerItem(EnumPresetItem::FinishExpOffsetTimes, "FinishExpOffsetTimes", "0");

    initialize();
}
